<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <title>Detalhe do tipo de usu&aacute;rio</title>
            <link rel="stylesheet" type="text/css" href="/globalimage2/faces/jsfcrud.css" /><%@ include file="/WEB-INF/jspf/AjaxScripts.jspf" %><script type="text/javascript" src="/globalimage2/faces/jsfcrud.js"></script>
        </head>
        <body>
            <%@include file="../../WEB-INF/jspf/header/head.jspf"%>
            <div style="float:left">
                <%@include file="../../WEB-INF/jspf/header/menuDinamico.jspf"%>
            </div>
            <div id="div_content">
                <div class="bgContentTable">
                    <div class="titleTable"><h3>Detalhe do tipo de usu&aacute;rio</h3></div><br />

                    <h:form>
                        <h:panelGroup id="messagePanel" layout="block">
                            <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                        </h:panelGroup>
                       
                        &nbsp;&nbsp;<h:commandLink action="#{tipoUsuario.createSetup}" value="Novo" />
                        &nbsp;|&nbsp;
                        <h:commandLink action="#{tipoUsuario.editSetup}" value="Editar">
                           <f:param name="jsfcrud.currentTipoUsuario" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][tipoUsuario.tipoUsuario][tipoUsuario.converter].jsfcrud_invoke}" />
                        </h:commandLink>
                        &nbsp;|&nbsp;
                        <h:commandLink action="#{tipoUsuario.listSetup}" value="Exibir todos"/>
                       
                        <h:panelGrid columns="2">
                            <h:outputText value="Nome:"/>
                            <h:outputText value="#{tipoUsuario.tipoUsuario.nome}" title="Nome" />
                            <h:outputText value="Vínculo:"/>
                            <h:outputText value="#{tipoUsuario.tipoUsuario.vinculoId.nome}"/>
                            
                            <h:outputText value="Permissões associadas a este usuário:" />
                            <h:panelGroup>
                                <h:outputText rendered="#{empty tipoUsuario.tipoUsuario.permissaoCollection}" value="(No Items)"/>
                                <h:dataTable value="#{tipoUsuario.tipoUsuario.permissaoCollection}" var="item"
                                             border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px"
                                             rendered="#{not empty tipoUsuario.tipoUsuario.permissaoCollection}">
                                    <h:column>
                                        <div class="nome200px">
                                            <f:facet name="header">
                                                <h:outputText value="Página"/>
                                            </f:facet>
                                        </div>
                                            <h:commandLink action="#{permissao.detailSetup}">
                                                <f:param name="jsfcrud.currentTipoUsuario" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][tipoUsuario.tipoUsuario][tipoUsuario.converter].jsfcrud_invoke}"/>
                                                <f:param name="jsfcrud.currentPermissao" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][item][permissao.converter].jsfcrud_invoke}"/>
                                                <f:param name="jsfcrud.relatedController" value="tipoUsuario" />
                                                <f:param name="jsfcrud.relatedControllerType" value="entidade.controller.JSF.TipoUsuarioController" />
                                                <h:outputText value=" #{item.pagina}"/>
                                            </h:commandLink>
                                        
                                    </h:column>
                                    <h:column>
                                        <div class="nome200px">
                                            <f:facet name="header">
                                                <h:outputText value="Descrição"/>
                                            </f:facet>
                                            <h:outputText value=" #{item.descricao}"/>
                                        </div>
                                    </h:column>
                                </h:dataTable>
                            </h:panelGroup>
                            <h:outputText value="Usuários associados a esse tipo:" />
                            <h:panelGroup>
                                <h:outputText rendered="#{empty tipoUsuario.tipoUsuario.usuarioCollection}" value="(Sem Ítens)"/>
                                <h:dataTable value="#{tipoUsuario.tipoUsuario.usuarioCollection}" var="item"
                                             border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px"
                                             rendered="#{not empty tipoUsuario.tipoUsuario.usuarioCollection}">
                                    <h:column>
                                        <f:facet name="header">
                                                <h:outputText value="Nome"/>
                                        </f:facet>
                                        <div class="nome200px">
                                            <h:outputText value=" #{item.nome}"/>
                                        </div>
                                    </h:column>
                                    <h:column>
                                        <div class="nome200px">
                                            <h:commandLink action="#{usuario.detailSetup}">
                                                <f:param name="jsfcrud.currentTipoUsuario" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][tipoUsuario.tipoUsuario][tipoUsuario.converter].jsfcrud_invoke}"/>
                                                <f:param name="jsfcrud.currentUsuario" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][item][usuario.converter].jsfcrud_invoke}"/>
                                                <f:param name="jsfcrud.relatedController" value="tipoUsuario" />
                                                <f:param name="jsfcrud.relatedControllerType" value="entidade.controller.JSF.TipoUsuarioController" />

                                                <f:facet name="header">
                                                    <h:outputText value="Empresa"/>
                                                </f:facet>
                                                <h:outputText value=" #{item.empresaId}"/>
                                            </h:commandLink>
                                        </div>
                                    </h:column>

                                </h:dataTable>
                            </h:panelGroup>
                        </h:panelGrid>
                    </h:form>
                </div>
            </div>
        </body>
    </html>
</f:view>
